package com.love.cloud.common.core.exception;

import com.love.cloud.common.core.constant.enums.ResultCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 认证异常
 * @author hongdongqu
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class AuthException extends RuntimeException{
    protected Integer code;

    protected String message;

    public AuthException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    public AuthException(String message) {
        this.code = 1;
        this.message = message;
    }
    public AuthException(ResultCode resultCode) {
        this.code = resultCode.code();
        this.message = resultCode.message();
    }
}
